using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Windows.Forms;
using Slaks.Analysis.Mediators;
using Slaks.Graphs.GraphBuilder;

namespace Slaks.Analysis
{
	/// <summary>
	/// Summary description for Form1.
	/// </summary>
	public class Form1 : Form
	{
		private GroupBox m_modeGB;
		private RadioButton m_comparisonModeRB;
		private RadioButton m_singleModeRB;
		private GroupBox m_representationGB;
		private GroupBox m_distanceAlgGB;
		private RadioButton m_wguRB;
		private RadioButton m_mcsRB;
		private GroupBox m_typeGB;
		private RadioButton m_graphTypeRB;
		private RadioButton m_vectorTypeRB;
		private GroupBox m_globalDictionaryFileGB;
		private TextBox m_globalDictionaryFileTB;
		private Button m_globalDictionaryFileBtn;
		private CheckBox m_globalDictionaryFileCB;
		private Panel m_upperPanel;
		private RadioButton m_jacaardSimilarityRB;
		private RadioButton m_cosineSimilarityRB;
		private ListView m_fileListLV;
		private ColumnHeader m_fileListCH;
		private NumericUpDown m_distanceValueUD;
		private OpenFileDialog m_openFileDialog;
		private Button m_globalDictionaryFileShowBtn;
		private ContextMenu m_fileListCM;
		private MenuItem m_addFilesMI;
		private MenuItem m_removeFilesMI;
		private MenuItem m_clearListMI;
		private MenuItem m_countFilesMI;
		private MenuItem m_addFilesDirectoryMI;
		private MenuItem m_saveFileListMI;
		private MenuItem m_loadFileListMI;
		private MenuItem m_runMI;
		private Label m_graphSizeL;
		private NumericUpDown m_graphSizeUD;
		private GroupBox m_categoryFileGB;
		private Button m_categoryFileShowBtn;
		private CheckBox m_categoryFileCB;
		private Button m_categoryFileBtn;
		private TextBox m_categoryFileTB;

		private MenuItem m_showFilesMI;
		private MenuItem m_separator1;
		private MenuItem m_separator2;
		private MenuItem m_separator3;
		private MenuItem m_separator4;

		private GroupBox m_localDictionaryFileGB;
		private Button m_localDictionaryFileShowBtn;
		private CheckBox m_localDictionaryFileCB;
		private Button m_localDictionaryFileBtn;
		private TextBox m_localDictionaryFileTB;

		private Container components = null;

		#region My Variables

		private Type m_currentType;
		private BuilderType m_currentRepresentation;
		private Mode m_currentMode;
		private DistanceAlgorithm m_currentDistanceAlgorithm;
		private bool m_isGlobalDictionaryNeeded = false;
		private bool m_isLocalDictionaryNeeded = false;
		private bool m_isCategoryFileNeeded = false;
		private int m_typeSize;
		private FileListMediator m_fileListMediator;
		private AnalysisMediator m_analysisMediator;
		private ComboBox m_representationListCB;
		private Label m_distanceValueL;
		private RadioButton m_slaksWGURB;
		private RadioButton m_slaksMCSRB;
		private int m_distanceValue;

		#endregion

		public Form1()
		{
			InitializeComponent();
			this.Init();
			m_fileListMediator = new FileListMediator(this, m_fileListLV);
			m_analysisMediator = new AnalysisMediator(this);
			GraphBuilderMediator.AddRepresentation();


		}

		private void Init()
		{
			m_vectorTypeRB.Checked = true;
			this.EnableType(Type.Vector);
			m_singleModeRB.Checked = true;
			this.EnableDistanceValue(BuilderType.StandardRepresentationSchenker);
			m_cosineSimilarityRB.Checked = true;
			m_currentDistanceAlgorithm = DistanceAlgorithm.COS;

			//init the representation list combo box
			m_representationListCB.Items.Add(BuilderType.StandardRepresentationSchenker);
			m_representationListCB.Items.Add(BuilderType.StandardRepresentationSlaks);
			m_representationListCB.Items.Add(BuilderType.SimpleRepresentationSchenker);
			m_representationListCB.Items.Add(BuilderType.SimpleRepresentationSlaks);
			m_representationListCB.Items.Add(BuilderType.NDistanceRepresentationSchenker);
			m_representationListCB.Items.Add(BuilderType.NDistanceRepresentationSlaks);
			m_representationListCB.Items.Add(BuilderType.NSimpleDistanceRepresentationSchenker);
			m_representationListCB.Items.Add(BuilderType.NSimpleDistanceRepresentationSlaks);
			m_representationListCB.Items.Add(BuilderType.RawFrequencyRepresentationSchenker);
			m_representationListCB.Items.Add(BuilderType.RawFrequencyRepresentationSlaks);
			m_representationListCB.Items.Add(BuilderType.NormalizedFrequencyRepresentationSchenker);
			m_representationListCB.Items.Add(BuilderType.NormalizedFrequencyRepresentationSchenker);

			m_representationListCB.SelectedItem = BuilderType.StandardRepresentationSchenker;
		}

		private void EnableType(Type type)
		{
			if (type == Type.Vector)
			{
				this.EnableDistanceAlgorithm(DistanceAlgorithm.MSC, false);
				this.EnableDistanceAlgorithm(DistanceAlgorithm.WGU, false);
				this.EnableDistanceAlgorithm(DistanceAlgorithm.SlaksMCS, false);
				this.EnableDistanceAlgorithm(DistanceAlgorithm.SlaksWGU, false);
				this.EnableDistanceAlgorithm(DistanceAlgorithm.COS, true);
				this.EnableDistanceAlgorithm(DistanceAlgorithm.JACCARD, true);

				if (m_mcsRB.Checked || m_wguRB.Checked || m_slaksMCSRB.Checked || m_slaksWGURB.Checked)
				{
					m_cosineSimilarityRB.Checked = true;
					m_currentDistanceAlgorithm = DistanceAlgorithm.COS;

				}
				m_graphSizeL.Enabled = m_graphSizeUD.Enabled = false;

			}
			else
			{
				this.EnableDistanceAlgorithm(DistanceAlgorithm.MSC, true);
				this.EnableDistanceAlgorithm(DistanceAlgorithm.WGU, true);
				this.EnableDistanceAlgorithm(DistanceAlgorithm.SlaksMCS, true);
				this.EnableDistanceAlgorithm(DistanceAlgorithm.SlaksWGU, true);
				this.EnableDistanceAlgorithm(DistanceAlgorithm.COS, false);
				this.EnableDistanceAlgorithm(DistanceAlgorithm.JACCARD, false);

				if (m_cosineSimilarityRB.Checked || m_jacaardSimilarityRB.Checked)
				{
					m_mcsRB.Checked = true;
					m_currentDistanceAlgorithm = DistanceAlgorithm.MSC;
				}

				m_graphSizeL.Enabled = m_graphSizeUD.Enabled = true;
			}
		}

		private void EnableDistanceValue(BuilderType representation)
		{
			m_currentRepresentation = representation;
			if (representation == BuilderType.NDistanceRepresentationSchenker ||
				representation == BuilderType.NDistanceRepresentationSlaks ||
				representation == BuilderType.NSimpleDistanceRepresentationSchenker ||
				representation == BuilderType.NSimpleDistanceRepresentationSlaks)
			{
				m_distanceValueUD.Enabled = true;
			}
			else m_distanceValueUD.Enabled = false;
		}

		public void EnableDistanceAlgorithm(DistanceAlgorithm distanceAlgorithm, bool isEnable)
		{
			switch (distanceAlgorithm)
			{
				case DistanceAlgorithm.MSC:
					{
						m_mcsRB.Enabled = (isEnable == true) ? true : false;
						break;
					}
				case DistanceAlgorithm.WGU:
					m_wguRB.Enabled = (isEnable == true) ? true : false;
					break;
				case DistanceAlgorithm.SlaksMCS:
					{
						m_slaksMCSRB.Enabled = (isEnable == true) ? true : false;
						break;
					}
				case DistanceAlgorithm.SlaksWGU:
					m_slaksWGURB.Enabled = (isEnable == true) ? true : false;
					break;
				case DistanceAlgorithm.COS:
					m_cosineSimilarityRB.Enabled = (isEnable == true) ? true : false;
					break;
				case DistanceAlgorithm.JACCARD:
					m_jacaardSimilarityRB.Enabled = (isEnable == true) ? true : false;
					break;
			}
		}

		private void OpenGlobalDictionaryFile()
		{
			m_openFileDialog.Title = "Global Dictionary Xml File";
			m_openFileDialog.Filter = "Xml Dictionary File|*.xml|All Files|*.*";
			if (m_openFileDialog.ShowDialog(this) == DialogResult.OK)
			{
				m_globalDictionaryFileTB.Text = m_openFileDialog.FileName;
			}
		}

		private void OpenLocalDictionaryFile()
		{
			m_openFileDialog.Title = "Local Dictionary Xml File";
			m_openFileDialog.Filter = "Xml Dictionary File|*.xml|All Files|*.*";
			if (m_openFileDialog.ShowDialog(this) == DialogResult.OK)
			{
				m_localDictionaryFileTB.Text = m_openFileDialog.FileName;
			}
		}

		private void OpenCategoryFile()
		{
			m_openFileDialog.Title = "Category File";
			m_openFileDialog.Filter = "Category File|*.txt|All Files|*.*";
			if (m_openFileDialog.ShowDialog(this) == DialogResult.OK)
			{
				m_categoryFileTB.Text = m_openFileDialog.FileName;
			}
		}


		private void RadioButtonHandler(object sender, EventArgs e)
		{
			if (sender == m_vectorTypeRB)
			{
				this.EnableType(Type.Vector);
				m_currentType = Type.Vector;
			}
			if (sender == m_graphTypeRB)
			{
				this.EnableType(Type.Graph);
				m_currentType = Type.Graph;
			}

			if (sender == m_mcsRB) m_currentDistanceAlgorithm = DistanceAlgorithm.MSC;
			if (sender == m_wguRB) m_currentDistanceAlgorithm = DistanceAlgorithm.WGU;
			if (sender == m_slaksMCSRB) m_currentDistanceAlgorithm = DistanceAlgorithm.SlaksMCS;
			if (sender == m_slaksWGURB) m_currentDistanceAlgorithm = DistanceAlgorithm.SlaksWGU;

			if (sender == m_cosineSimilarityRB) m_currentDistanceAlgorithm = DistanceAlgorithm.COS;
			if (sender == m_jacaardSimilarityRB) m_currentDistanceAlgorithm = DistanceAlgorithm.JACCARD;

			if (sender == m_singleModeRB) m_currentMode = Mode.Single;
			if (sender == m_comparisonModeRB) m_currentMode = Mode.Comparison;
		}

		private void ButtonClickHandler(object sender, EventArgs e)
		{
			if (sender == m_globalDictionaryFileBtn) this.OpenGlobalDictionaryFile();
			if (sender == m_globalDictionaryFileCB) m_isGlobalDictionaryNeeded = m_globalDictionaryFileCB.Checked;
			if (sender == m_globalDictionaryFileShowBtn) this.ShowFile(m_globalDictionaryFileTB);

			if (sender == m_localDictionaryFileBtn) this.OpenLocalDictionaryFile();
			if (sender == m_localDictionaryFileCB) m_isLocalDictionaryNeeded = m_localDictionaryFileCB.Checked;
			if (sender == m_localDictionaryFileShowBtn) this.ShowFile(m_localDictionaryFileTB);

			if (sender == m_categoryFileShowBtn) this.ShowFile(m_categoryFileTB);
			if (sender == m_categoryFileCB) m_isCategoryFileNeeded = m_categoryFileCB.Checked;
			if (sender == m_categoryFileBtn) this.OpenCategoryFile();

			if (sender == m_addFilesMI) m_fileListMediator.AddFiles(AddFileMode.File);
			if (sender == m_addFilesDirectoryMI) m_fileListMediator.AddFiles(AddFileMode.Directory);
			if (sender == m_removeFilesMI) m_fileListMediator.DeleteFiles();
			if (sender == m_countFilesMI) m_fileListMediator.CountFiles();
			if (sender == m_clearListMI) m_fileListMediator.ClearFileList();
			if (sender == m_showFilesMI) m_fileListMediator.ShowSelectedFiles();
			if (sender == m_saveFileListMI) m_fileListMediator.SaveFileList();
			if (sender == m_loadFileListMI) m_fileListMediator.LoadFileList();

			if (sender == m_representationListCB) this.ChangeCurrentRepresentation();

			if (sender == m_runMI) this.RunComparisons();
		}

		private void ChangeCurrentRepresentation()
		{
			m_currentRepresentation = (BuilderType) m_representationListCB.SelectedItem;
			this.EnableDistanceValue(m_currentRepresentation);
		}

		private void ShowFile(Control control)
		{
			string filename = control.Text;
			try
			{
				Process.Start(filename);
			}
			catch (Exception)
			{
			}
		}

		private void RunComparisons()
		{
			try
			{
				m_distanceValue = (int) m_distanceValueUD.Value;
				string[] files = m_fileListMediator.GetSelectedFiles();
				if (files == null) throw new Exception("At least one file must be selected");
				if (m_currentMode == Mode.Comparison && files.Length == 1) throw new Exception("Comparison mode is selected but only one file is highlighted, must be two");
				try
				{
					if (m_currentMode == Mode.Single && files.Length > 1) throw new Exception("More than 1 files are selected, the first one will be considered");
					if (m_currentMode == Mode.Comparison && files.Length > 2) throw new Exception("More than 2 files are selected, first two will be considered");
				}
				catch (Exception ex)
				{
					MessageBox.Show(this, ex.Message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
				}

				if (m_currentType == Type.Graph)
				{
					m_typeSize = (int) m_graphSizeUD.Value;
					if (m_currentMode == Mode.Single)
					{
						m_analysisMediator.RunGraphSingle(files[0], m_typeSize, m_currentRepresentation, m_distanceValue, m_currentDistanceAlgorithm);
					}
					else
					{
						m_analysisMediator.RunGraphComparison(files[0], files[1], m_typeSize, m_currentRepresentation, m_distanceValue, m_currentDistanceAlgorithm);
					}
				}
				else if (m_currentType == Type.Vector)
				{
					if (m_currentMode == Mode.Single)
					{
						m_analysisMediator.RunVectorSingle(files[0], GetLocalDictionaryFileName(), m_currentRepresentation, m_currentDistanceAlgorithm);
					}
					else
					{
						m_analysisMediator.RunVectorComparison(files[0], files[1], GetLocalDictionaryFileName(), m_currentRepresentation, m_currentDistanceAlgorithm);
					}
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
			}
		}

		private string GetLocalDictionaryFileName()
		{
			return m_localDictionaryFileTB.Text;
		}

		#region Dispose

		protected override void Dispose(bool disposing)
		{
			if (disposing)
			{
				if (components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose(disposing);
		}

		#endregion

		#region Windows Form Designer generated code

		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.m_upperPanel = new System.Windows.Forms.Panel();
			this.m_localDictionaryFileGB = new System.Windows.Forms.GroupBox();
			this.m_localDictionaryFileShowBtn = new System.Windows.Forms.Button();
			this.m_localDictionaryFileCB = new System.Windows.Forms.CheckBox();
			this.m_localDictionaryFileBtn = new System.Windows.Forms.Button();
			this.m_localDictionaryFileTB = new System.Windows.Forms.TextBox();
			this.m_categoryFileGB = new System.Windows.Forms.GroupBox();
			this.m_categoryFileShowBtn = new System.Windows.Forms.Button();
			this.m_categoryFileCB = new System.Windows.Forms.CheckBox();
			this.m_categoryFileBtn = new System.Windows.Forms.Button();
			this.m_categoryFileTB = new System.Windows.Forms.TextBox();
			this.m_globalDictionaryFileGB = new System.Windows.Forms.GroupBox();
			this.m_globalDictionaryFileShowBtn = new System.Windows.Forms.Button();
			this.m_globalDictionaryFileCB = new System.Windows.Forms.CheckBox();
			this.m_globalDictionaryFileBtn = new System.Windows.Forms.Button();
			this.m_globalDictionaryFileTB = new System.Windows.Forms.TextBox();
			this.m_modeGB = new System.Windows.Forms.GroupBox();
			this.m_comparisonModeRB = new System.Windows.Forms.RadioButton();
			this.m_singleModeRB = new System.Windows.Forms.RadioButton();
			this.m_representationGB = new System.Windows.Forms.GroupBox();
			this.m_distanceValueL = new System.Windows.Forms.Label();
			this.m_representationListCB = new System.Windows.Forms.ComboBox();
			this.m_distanceValueUD = new System.Windows.Forms.NumericUpDown();
			this.m_distanceAlgGB = new System.Windows.Forms.GroupBox();
			this.m_slaksWGURB = new System.Windows.Forms.RadioButton();
			this.m_slaksMCSRB = new System.Windows.Forms.RadioButton();
			this.m_jacaardSimilarityRB = new System.Windows.Forms.RadioButton();
			this.m_cosineSimilarityRB = new System.Windows.Forms.RadioButton();
			this.m_wguRB = new System.Windows.Forms.RadioButton();
			this.m_mcsRB = new System.Windows.Forms.RadioButton();
			this.m_typeGB = new System.Windows.Forms.GroupBox();
			this.m_graphSizeL = new System.Windows.Forms.Label();
			this.m_graphSizeUD = new System.Windows.Forms.NumericUpDown();
			this.m_graphTypeRB = new System.Windows.Forms.RadioButton();
			this.m_vectorTypeRB = new System.Windows.Forms.RadioButton();
			this.m_fileListLV = new System.Windows.Forms.ListView();
			this.m_fileListCH = new System.Windows.Forms.ColumnHeader();
			this.m_fileListCM = new System.Windows.Forms.ContextMenu();
			this.m_addFilesMI = new System.Windows.Forms.MenuItem();
			this.m_removeFilesMI = new System.Windows.Forms.MenuItem();
			this.m_addFilesDirectoryMI = new System.Windows.Forms.MenuItem();
			this.m_separator1 = new System.Windows.Forms.MenuItem();
			this.m_clearListMI = new System.Windows.Forms.MenuItem();
			this.m_separator2 = new System.Windows.Forms.MenuItem();
			this.m_countFilesMI = new System.Windows.Forms.MenuItem();
			this.m_showFilesMI = new System.Windows.Forms.MenuItem();
			this.m_separator3 = new System.Windows.Forms.MenuItem();
			this.m_saveFileListMI = new System.Windows.Forms.MenuItem();
			this.m_loadFileListMI = new System.Windows.Forms.MenuItem();
			this.m_separator4 = new System.Windows.Forms.MenuItem();
			this.m_runMI = new System.Windows.Forms.MenuItem();
			this.m_openFileDialog = new System.Windows.Forms.OpenFileDialog();
			this.m_upperPanel.SuspendLayout();
			this.m_localDictionaryFileGB.SuspendLayout();
			this.m_categoryFileGB.SuspendLayout();
			this.m_globalDictionaryFileGB.SuspendLayout();
			this.m_modeGB.SuspendLayout();
			this.m_representationGB.SuspendLayout();
			((System.ComponentModel.ISupportInitialize) (this.m_distanceValueUD)).BeginInit();
			this.m_distanceAlgGB.SuspendLayout();
			this.m_typeGB.SuspendLayout();
			((System.ComponentModel.ISupportInitialize) (this.m_graphSizeUD)).BeginInit();
			this.SuspendLayout();
			// 
			// m_upperPanel
			// 
			this.m_upperPanel.Controls.Add(this.m_localDictionaryFileGB);
			this.m_upperPanel.Controls.Add(this.m_categoryFileGB);
			this.m_upperPanel.Controls.Add(this.m_globalDictionaryFileGB);
			this.m_upperPanel.Controls.Add(this.m_modeGB);
			this.m_upperPanel.Controls.Add(this.m_representationGB);
			this.m_upperPanel.Controls.Add(this.m_distanceAlgGB);
			this.m_upperPanel.Controls.Add(this.m_typeGB);
			this.m_upperPanel.Dock = System.Windows.Forms.DockStyle.Top;
			this.m_upperPanel.Location = new System.Drawing.Point(0, 0);
			this.m_upperPanel.Name = "m_upperPanel";
			this.m_upperPanel.Size = new System.Drawing.Size(1040, 416);
			this.m_upperPanel.TabIndex = 4;
			this.m_upperPanel.Paint += new System.Windows.Forms.PaintEventHandler(this.m_upperPanel_Paint);
			// 
			// m_localDictionaryFileGB
			// 
			this.m_localDictionaryFileGB.Controls.Add(this.m_localDictionaryFileShowBtn);
			this.m_localDictionaryFileGB.Controls.Add(this.m_localDictionaryFileCB);
			this.m_localDictionaryFileGB.Controls.Add(this.m_localDictionaryFileBtn);
			this.m_localDictionaryFileGB.Controls.Add(this.m_localDictionaryFileTB);
			this.m_localDictionaryFileGB.Location = new System.Drawing.Point(8, 272);
			this.m_localDictionaryFileGB.Name = "m_localDictionaryFileGB";
			this.m_localDictionaryFileGB.Size = new System.Drawing.Size(800, 64);
			this.m_localDictionaryFileGB.TabIndex = 10;
			this.m_localDictionaryFileGB.TabStop = false;
			this.m_localDictionaryFileGB.Text = "Local Dictionary File";
			// 
			// m_localDictionaryFileShowBtn
			// 
			this.m_localDictionaryFileShowBtn.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.m_localDictionaryFileShowBtn.Location = new System.Drawing.Point(48, 22);
			this.m_localDictionaryFileShowBtn.Name = "m_localDictionaryFileShowBtn";
			this.m_localDictionaryFileShowBtn.Size = new System.Drawing.Size(48, 24);
			this.m_localDictionaryFileShowBtn.TabIndex = 3;
			this.m_localDictionaryFileShowBtn.Text = "Show";
			this.m_localDictionaryFileShowBtn.Click += new System.EventHandler(this.ButtonClickHandler);
			// 
			// m_localDictionaryFileCB
			// 
			this.m_localDictionaryFileCB.Location = new System.Drawing.Point(16, 22);
			this.m_localDictionaryFileCB.Name = "m_localDictionaryFileCB";
			this.m_localDictionaryFileCB.Size = new System.Drawing.Size(24, 24);
			this.m_localDictionaryFileCB.TabIndex = 2;
			// 
			// m_localDictionaryFileBtn
			// 
			this.m_localDictionaryFileBtn.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.m_localDictionaryFileBtn.Location = new System.Drawing.Point(752, 22);
			this.m_localDictionaryFileBtn.Name = "m_localDictionaryFileBtn";
			this.m_localDictionaryFileBtn.Size = new System.Drawing.Size(40, 24);
			this.m_localDictionaryFileBtn.TabIndex = 1;
			this.m_localDictionaryFileBtn.Text = "...";
			this.m_localDictionaryFileBtn.Click += new System.EventHandler(this.ButtonClickHandler);
			// 
			// m_localDictionaryFileTB
			// 
			this.m_localDictionaryFileTB.Location = new System.Drawing.Point(104, 24);
			this.m_localDictionaryFileTB.Name = "m_localDictionaryFileTB";
			this.m_localDictionaryFileTB.Size = new System.Drawing.Size(640, 20);
			this.m_localDictionaryFileTB.TabIndex = 0;
			this.m_localDictionaryFileTB.Text = "";
			// 
			// m_categoryFileGB
			// 
			this.m_categoryFileGB.Controls.Add(this.m_categoryFileShowBtn);
			this.m_categoryFileGB.Controls.Add(this.m_categoryFileCB);
			this.m_categoryFileGB.Controls.Add(this.m_categoryFileBtn);
			this.m_categoryFileGB.Controls.Add(this.m_categoryFileTB);
			this.m_categoryFileGB.Location = new System.Drawing.Point(8, 344);
			this.m_categoryFileGB.Name = "m_categoryFileGB";
			this.m_categoryFileGB.Size = new System.Drawing.Size(800, 64);
			this.m_categoryFileGB.TabIndex = 9;
			this.m_categoryFileGB.TabStop = false;
			this.m_categoryFileGB.Text = "Category File";
			// 
			// m_categoryFileShowBtn
			// 
			this.m_categoryFileShowBtn.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.m_categoryFileShowBtn.Location = new System.Drawing.Point(48, 22);
			this.m_categoryFileShowBtn.Name = "m_categoryFileShowBtn";
			this.m_categoryFileShowBtn.Size = new System.Drawing.Size(48, 24);
			this.m_categoryFileShowBtn.TabIndex = 3;
			this.m_categoryFileShowBtn.Text = "Show";
			this.m_categoryFileShowBtn.Click += new System.EventHandler(this.ButtonClickHandler);
			// 
			// m_categoryFileCB
			// 
			this.m_categoryFileCB.Location = new System.Drawing.Point(16, 22);
			this.m_categoryFileCB.Name = "m_categoryFileCB";
			this.m_categoryFileCB.Size = new System.Drawing.Size(24, 24);
			this.m_categoryFileCB.TabIndex = 2;
			this.m_categoryFileCB.Click += new System.EventHandler(this.ButtonClickHandler);
			// 
			// m_categoryFileBtn
			// 
			this.m_categoryFileBtn.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.m_categoryFileBtn.Location = new System.Drawing.Point(752, 22);
			this.m_categoryFileBtn.Name = "m_categoryFileBtn";
			this.m_categoryFileBtn.Size = new System.Drawing.Size(40, 24);
			this.m_categoryFileBtn.TabIndex = 1;
			this.m_categoryFileBtn.Text = "...";
			this.m_categoryFileBtn.Click += new System.EventHandler(this.ButtonClickHandler);
			// 
			// m_categoryFileTB
			// 
			this.m_categoryFileTB.Location = new System.Drawing.Point(104, 24);
			this.m_categoryFileTB.Name = "m_categoryFileTB";
			this.m_categoryFileTB.Size = new System.Drawing.Size(640, 20);
			this.m_categoryFileTB.TabIndex = 0;
			this.m_categoryFileTB.Text = "";
			// 
			// m_globalDictionaryFileGB
			// 
			this.m_globalDictionaryFileGB.Controls.Add(this.m_globalDictionaryFileShowBtn);
			this.m_globalDictionaryFileGB.Controls.Add(this.m_globalDictionaryFileCB);
			this.m_globalDictionaryFileGB.Controls.Add(this.m_globalDictionaryFileBtn);
			this.m_globalDictionaryFileGB.Controls.Add(this.m_globalDictionaryFileTB);
			this.m_globalDictionaryFileGB.Location = new System.Drawing.Point(8, 200);
			this.m_globalDictionaryFileGB.Name = "m_globalDictionaryFileGB";
			this.m_globalDictionaryFileGB.Size = new System.Drawing.Size(800, 64);
			this.m_globalDictionaryFileGB.TabIndex = 8;
			this.m_globalDictionaryFileGB.TabStop = false;
			this.m_globalDictionaryFileGB.Text = "Global Dictionary File";
			// 
			// m_globalDictionaryFileShowBtn
			// 
			this.m_globalDictionaryFileShowBtn.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.m_globalDictionaryFileShowBtn.Location = new System.Drawing.Point(48, 22);
			this.m_globalDictionaryFileShowBtn.Name = "m_globalDictionaryFileShowBtn";
			this.m_globalDictionaryFileShowBtn.Size = new System.Drawing.Size(48, 24);
			this.m_globalDictionaryFileShowBtn.TabIndex = 3;
			this.m_globalDictionaryFileShowBtn.Text = "Show";
			this.m_globalDictionaryFileShowBtn.Click += new System.EventHandler(this.ButtonClickHandler);
			// 
			// m_globalDictionaryFileCB
			// 
			this.m_globalDictionaryFileCB.Location = new System.Drawing.Point(16, 22);
			this.m_globalDictionaryFileCB.Name = "m_globalDictionaryFileCB";
			this.m_globalDictionaryFileCB.Size = new System.Drawing.Size(24, 24);
			this.m_globalDictionaryFileCB.TabIndex = 2;
			this.m_globalDictionaryFileCB.Click += new System.EventHandler(this.ButtonClickHandler);
			this.m_globalDictionaryFileCB.CheckedChanged += new System.EventHandler(this.ButtonClickHandler);
			// 
			// m_globalDictionaryFileBtn
			// 
			this.m_globalDictionaryFileBtn.FlatStyle = System.Windows.Forms.FlatStyle.System;
			this.m_globalDictionaryFileBtn.Location = new System.Drawing.Point(752, 22);
			this.m_globalDictionaryFileBtn.Name = "m_globalDictionaryFileBtn";
			this.m_globalDictionaryFileBtn.Size = new System.Drawing.Size(40, 24);
			this.m_globalDictionaryFileBtn.TabIndex = 1;
			this.m_globalDictionaryFileBtn.Text = "...";
			this.m_globalDictionaryFileBtn.Click += new System.EventHandler(this.ButtonClickHandler);
			// 
			// m_globalDictionaryFileTB
			// 
			this.m_globalDictionaryFileTB.Location = new System.Drawing.Point(104, 24);
			this.m_globalDictionaryFileTB.Name = "m_globalDictionaryFileTB";
			this.m_globalDictionaryFileTB.Size = new System.Drawing.Size(640, 20);
			this.m_globalDictionaryFileTB.TabIndex = 0;
			this.m_globalDictionaryFileTB.Text = "";
			// 
			// m_modeGB
			// 
			this.m_modeGB.Controls.Add(this.m_comparisonModeRB);
			this.m_modeGB.Controls.Add(this.m_singleModeRB);
			this.m_modeGB.Location = new System.Drawing.Point(672, 8);
			this.m_modeGB.Name = "m_modeGB";
			this.m_modeGB.Size = new System.Drawing.Size(120, 192);
			this.m_modeGB.TabIndex = 7;
			this.m_modeGB.TabStop = false;
			this.m_modeGB.Text = "Mode";
			// 
			// m_comparisonModeRB
			// 
			this.m_comparisonModeRB.Location = new System.Drawing.Point(16, 64);
			this.m_comparisonModeRB.Name = "m_comparisonModeRB";
			this.m_comparisonModeRB.Size = new System.Drawing.Size(88, 24);
			this.m_comparisonModeRB.TabIndex = 1;
			this.m_comparisonModeRB.Text = "Comparison";
			this.m_comparisonModeRB.Click += new System.EventHandler(this.RadioButtonHandler);
			// 
			// m_singleModeRB
			// 
			this.m_singleModeRB.Location = new System.Drawing.Point(16, 32);
			this.m_singleModeRB.Name = "m_singleModeRB";
			this.m_singleModeRB.Size = new System.Drawing.Size(64, 24);
			this.m_singleModeRB.TabIndex = 0;
			this.m_singleModeRB.Text = "Single";
			this.m_singleModeRB.Click += new System.EventHandler(this.RadioButtonHandler);
			// 
			// m_representationGB
			// 
			this.m_representationGB.Controls.Add(this.m_distanceValueL);
			this.m_representationGB.Controls.Add(this.m_representationListCB);
			this.m_representationGB.Controls.Add(this.m_distanceValueUD);
			this.m_representationGB.Location = new System.Drawing.Point(336, 8);
			this.m_representationGB.Name = "m_representationGB";
			this.m_representationGB.Size = new System.Drawing.Size(328, 192);
			this.m_representationGB.TabIndex = 6;
			this.m_representationGB.TabStop = false;
			this.m_representationGB.Text = "Representation";
			// 
			// m_distanceValueL
			// 
			this.m_distanceValueL.Location = new System.Drawing.Point(184, 80);
			this.m_distanceValueL.Name = "m_distanceValueL";
			this.m_distanceValueL.Size = new System.Drawing.Size(112, 23);
			this.m_distanceValueL.TabIndex = 8;
			this.m_distanceValueL.Text = "NDistance Parameter";
			// 
			// m_representationListCB
			// 
			this.m_representationListCB.Location = new System.Drawing.Point(24, 24);
			this.m_representationListCB.Name = "m_representationListCB";
			this.m_representationListCB.Size = new System.Drawing.Size(280, 21);
			this.m_representationListCB.TabIndex = 7;
			this.m_representationListCB.SelectedIndexChanged += new System.EventHandler(this.ButtonClickHandler);
			// 
			// m_distanceValueUD
			// 
			this.m_distanceValueUD.Location = new System.Drawing.Point(184, 112);
			this.m_distanceValueUD.Minimum = new System.Decimal(new int[]
				{
					1,
					0,
					0,
					0
				});
			this.m_distanceValueUD.Name = "m_distanceValueUD";
			this.m_distanceValueUD.Size = new System.Drawing.Size(112, 20);
			this.m_distanceValueUD.TabIndex = 6;
			this.m_distanceValueUD.Value = new System.Decimal(new int[]
				{
					1,
					0,
					0,
					0
				});
			// 
			// m_distanceAlgGB
			// 
			this.m_distanceAlgGB.Controls.Add(this.m_slaksWGURB);
			this.m_distanceAlgGB.Controls.Add(this.m_slaksMCSRB);
			this.m_distanceAlgGB.Controls.Add(this.m_jacaardSimilarityRB);
			this.m_distanceAlgGB.Controls.Add(this.m_cosineSimilarityRB);
			this.m_distanceAlgGB.Controls.Add(this.m_wguRB);
			this.m_distanceAlgGB.Controls.Add(this.m_mcsRB);
			this.m_distanceAlgGB.Location = new System.Drawing.Point(800, 8);
			this.m_distanceAlgGB.Name = "m_distanceAlgGB";
			this.m_distanceAlgGB.Size = new System.Drawing.Size(232, 192);
			this.m_distanceAlgGB.TabIndex = 5;
			this.m_distanceAlgGB.TabStop = false;
			this.m_distanceAlgGB.Text = "Distance algorithm";
			// 
			// m_slaksWGURB
			// 
			this.m_slaksWGURB.Location = new System.Drawing.Point(120, 72);
			this.m_slaksWGURB.Name = "m_slaksWGURB";
			this.m_slaksWGURB.TabIndex = 5;
			this.m_slaksWGURB.Text = "SlaksWGU";
			this.m_slaksWGURB.Click += new System.EventHandler(this.RadioButtonHandler);
			// 
			// m_slaksMCSRB
			// 
			this.m_slaksMCSRB.Location = new System.Drawing.Point(120, 32);
			this.m_slaksMCSRB.Name = "m_slaksMCSRB";
			this.m_slaksMCSRB.TabIndex = 4;
			this.m_slaksMCSRB.Text = "SlaksMCS";
			this.m_slaksMCSRB.Click += new System.EventHandler(this.RadioButtonHandler);
			// 
			// m_jacaardSimilarityRB
			// 
			this.m_jacaardSimilarityRB.Location = new System.Drawing.Point(16, 144);
			this.m_jacaardSimilarityRB.Name = "m_jacaardSimilarityRB";
			this.m_jacaardSimilarityRB.Size = new System.Drawing.Size(136, 32);
			this.m_jacaardSimilarityRB.TabIndex = 3;
			this.m_jacaardSimilarityRB.Text = "JACAARD Similarity";
			this.m_jacaardSimilarityRB.Click += new System.EventHandler(this.RadioButtonHandler);
			// 
			// m_cosineSimilarityRB
			// 
			this.m_cosineSimilarityRB.Location = new System.Drawing.Point(16, 112);
			this.m_cosineSimilarityRB.Name = "m_cosineSimilarityRB";
			this.m_cosineSimilarityRB.Size = new System.Drawing.Size(128, 24);
			this.m_cosineSimilarityRB.TabIndex = 2;
			this.m_cosineSimilarityRB.Text = "COSINE Similarity";
			this.m_cosineSimilarityRB.Click += new System.EventHandler(this.RadioButtonHandler);
			// 
			// m_wguRB
			// 
			this.m_wguRB.Location = new System.Drawing.Point(16, 72);
			this.m_wguRB.Name = "m_wguRB";
			this.m_wguRB.TabIndex = 1;
			this.m_wguRB.Text = "WGU";
			this.m_wguRB.Click += new System.EventHandler(this.RadioButtonHandler);
			// 
			// m_mcsRB
			// 
			this.m_mcsRB.Location = new System.Drawing.Point(16, 32);
			this.m_mcsRB.Name = "m_mcsRB";
			this.m_mcsRB.TabIndex = 0;
			this.m_mcsRB.Text = "MCS";
			this.m_mcsRB.Click += new System.EventHandler(this.RadioButtonHandler);
			// 
			// m_typeGB
			// 
			this.m_typeGB.Controls.Add(this.m_graphSizeL);
			this.m_typeGB.Controls.Add(this.m_graphSizeUD);
			this.m_typeGB.Controls.Add(this.m_graphTypeRB);
			this.m_typeGB.Controls.Add(this.m_vectorTypeRB);
			this.m_typeGB.Location = new System.Drawing.Point(8, 8);
			this.m_typeGB.Name = "m_typeGB";
			this.m_typeGB.Size = new System.Drawing.Size(320, 192);
			this.m_typeGB.TabIndex = 4;
			this.m_typeGB.TabStop = false;
			this.m_typeGB.Text = "Type";
			// 
			// m_graphSizeL
			// 
			this.m_graphSizeL.Location = new System.Drawing.Point(176, 81);
			this.m_graphSizeL.Name = "m_graphSizeL";
			this.m_graphSizeL.Size = new System.Drawing.Size(64, 18);
			this.m_graphSizeL.TabIndex = 5;
			this.m_graphSizeL.Text = "Graph size";
			// 
			// m_graphSizeUD
			// 
			this.m_graphSizeUD.Location = new System.Drawing.Point(248, 80);
			this.m_graphSizeUD.Maximum = new System.Decimal(new int[]
				{
					1000,
					0,
					0,
					0
				});
			this.m_graphSizeUD.Name = "m_graphSizeUD";
			this.m_graphSizeUD.Size = new System.Drawing.Size(56, 20);
			this.m_graphSizeUD.TabIndex = 4;
			this.m_graphSizeUD.Value = new System.Decimal(new int[]
				{
					50,
					0,
					0,
					0
				});
			// 
			// m_graphTypeRB
			// 
			this.m_graphTypeRB.Location = new System.Drawing.Point(16, 80);
			this.m_graphTypeRB.Name = "m_graphTypeRB";
			this.m_graphTypeRB.Size = new System.Drawing.Size(64, 22);
			this.m_graphTypeRB.TabIndex = 1;
			this.m_graphTypeRB.Text = "Graph";
			this.m_graphTypeRB.Click += new System.EventHandler(this.RadioButtonHandler);
			// 
			// m_vectorTypeRB
			// 
			this.m_vectorTypeRB.Location = new System.Drawing.Point(16, 30);
			this.m_vectorTypeRB.Name = "m_vectorTypeRB";
			this.m_vectorTypeRB.Size = new System.Drawing.Size(64, 24);
			this.m_vectorTypeRB.TabIndex = 0;
			this.m_vectorTypeRB.Text = "Vector";
			this.m_vectorTypeRB.Click += new System.EventHandler(this.RadioButtonHandler);
			// 
			// m_fileListLV
			// 
			this.m_fileListLV.Alignment = System.Windows.Forms.ListViewAlignment.SnapToGrid;
			this.m_fileListLV.AllowDrop = true;
			this.m_fileListLV.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.m_fileListLV.Columns.AddRange(new System.Windows.Forms.ColumnHeader[]
				{
					this.m_fileListCH
				});
			this.m_fileListLV.ContextMenu = this.m_fileListCM;
			this.m_fileListLV.Dock = System.Windows.Forms.DockStyle.Fill;
			this.m_fileListLV.FullRowSelect = true;
			this.m_fileListLV.GridLines = true;
			this.m_fileListLV.Location = new System.Drawing.Point(0, 416);
			this.m_fileListLV.Name = "m_fileListLV";
			this.m_fileListLV.Size = new System.Drawing.Size(1040, 294);
			this.m_fileListLV.TabIndex = 5;
			this.m_fileListLV.View = System.Windows.Forms.View.Details;
			this.m_fileListLV.SelectedIndexChanged += new System.EventHandler(this.ButtonClickHandler);
			// 
			// m_fileListCH
			// 
			this.m_fileListCH.Text = "File List";
			this.m_fileListCH.Width = 807;
			// 
			// m_fileListCM
			// 
			this.m_fileListCM.MenuItems.AddRange(new System.Windows.Forms.MenuItem[]
				{
					this.m_addFilesMI,
					this.m_removeFilesMI,
					this.m_addFilesDirectoryMI,
					this.m_separator1,
					this.m_clearListMI,
					this.m_separator2,
					this.m_countFilesMI,
					this.m_showFilesMI,
					this.m_separator3,
					this.m_saveFileListMI,
					this.m_loadFileListMI,
					this.m_separator4,
					this.m_runMI
				});
			// 
			// m_addFilesMI
			// 
			this.m_addFilesMI.Index = 0;
			this.m_addFilesMI.Text = "Add files";
			this.m_addFilesMI.Click += new System.EventHandler(this.ButtonClickHandler);
			// 
			// m_removeFilesMI
			// 
			this.m_removeFilesMI.Index = 1;
			this.m_removeFilesMI.Text = "Remove Selected Files";
			this.m_removeFilesMI.Click += new System.EventHandler(this.ButtonClickHandler);
			// 
			// m_addFilesDirectoryMI
			// 
			this.m_addFilesDirectoryMI.Index = 2;
			this.m_addFilesDirectoryMI.Text = "Add Files From Directiory";
			this.m_addFilesDirectoryMI.Click += new System.EventHandler(this.ButtonClickHandler);
			// 
			// m_separator1
			// 
			this.m_separator1.Index = 3;
			this.m_separator1.Text = "-";
			// 
			// m_clearListMI
			// 
			this.m_clearListMI.Index = 4;
			this.m_clearListMI.Text = "Clear List";
			this.m_clearListMI.Click += new System.EventHandler(this.ButtonClickHandler);
			// 
			// m_separator2
			// 
			this.m_separator2.Index = 5;
			this.m_separator2.Text = "-";
			// 
			// m_countFilesMI
			// 
			this.m_countFilesMI.Index = 6;
			this.m_countFilesMI.Text = "Count Files";
			this.m_countFilesMI.Click += new System.EventHandler(this.ButtonClickHandler);
			// 
			// m_showFilesMI
			// 
			this.m_showFilesMI.Index = 7;
			this.m_showFilesMI.Text = "Show Selected Files";
			this.m_showFilesMI.Click += new System.EventHandler(this.ButtonClickHandler);
			// 
			// m_separator3
			// 
			this.m_separator3.Index = 8;
			this.m_separator3.Text = "-";
			// 
			// m_saveFileListMI
			// 
			this.m_saveFileListMI.Index = 9;
			this.m_saveFileListMI.Text = "Save File List";
			this.m_saveFileListMI.Click += new System.EventHandler(this.ButtonClickHandler);
			// 
			// m_loadFileListMI
			// 
			this.m_loadFileListMI.Index = 10;
			this.m_loadFileListMI.Text = "Load File List";
			this.m_loadFileListMI.Click += new System.EventHandler(this.ButtonClickHandler);
			// 
			// m_separator4
			// 
			this.m_separator4.Index = 11;
			this.m_separator4.Text = "-";
			// 
			// m_runMI
			// 
			this.m_runMI.Index = 12;
			this.m_runMI.Text = "Run";
			this.m_runMI.Click += new System.EventHandler(this.ButtonClickHandler);
			// 
			// m_openFileDialog
			// 
			this.m_openFileDialog.RestoreDirectory = true;
			// 
			// Form1
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(1040, 710);
			this.Controls.Add(this.m_fileListLV);
			this.Controls.Add(this.m_upperPanel);
			this.MaximizeBox = false;
			this.Name = "Form1";
			this.Text = "Vector & Graph Analysis";
			this.m_upperPanel.ResumeLayout(false);
			this.m_localDictionaryFileGB.ResumeLayout(false);
			this.m_categoryFileGB.ResumeLayout(false);
			this.m_globalDictionaryFileGB.ResumeLayout(false);
			this.m_modeGB.ResumeLayout(false);
			this.m_representationGB.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize) (this.m_distanceValueUD)).EndInit();
			this.m_distanceAlgGB.ResumeLayout(false);
			this.m_typeGB.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize) (this.m_graphSizeUD)).EndInit();
			this.ResumeLayout(false);

		}

		#endregion

		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		private static void Main()
		{
			Application.EnableVisualStyles();
			Application.Run(new Form1());
		}

		private void m_upperPanel_Paint(object sender, PaintEventArgs e)
		{
		}
	}
}